package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.model3.ConfigsEntity;

public class TeMaiAreaAdapter extends AbsRecyclerViewAdapter<ConfigsEntity.BodyBean.SortsBean> {

    public TeMaiAreaAdapter(Context context) {
        super(context, R.layout.recycle_home_area);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, ConfigsEntity.BodyBean.SortsBean d, int position) {
        holder.bindTextView(R.id.tv_ha_title, d.getName());

        if (position == 0){
            holder.getView(R.id.vw_ha).setVisibility(View.VISIBLE);
        }else {
            holder.getView(R.id.vw_ha).setVisibility(View.GONE);
        }

        TextView tvTitle = (TextView) holder.getView(R.id.tv_ha_title);
        if (d.isCheck()) {
            tvTitle.setTextColor(context.getResources().getColor(R.color.colorF73637));
            holder.getView(R.id.iv_ha_title).setVisibility(View.VISIBLE);
        } else {
            tvTitle.setTextColor(context.getResources().getColor(R.color.colorTextBlack));
            holder.getView(R.id.iv_ha_title).setVisibility(View.GONE);
        }
    }
}

